LOW-CODE AI ยท COURSE v1.0

Master Dialogflow CX
From Scratch

Build production-grade conversational AI agents using Google's most powerful low-code framework โ€” no prior experience needed.

๐Ÿ“š

12 Lessons

From concepts to production deployment, every topic covered step by step.

๐Ÿ› ๏ธ

2 Full Projects

Pizza ordering bot and banking bot โ€” real-world scenarios you can extend.

๐ŸŽฏ

Assignments + Exam

Hands-on assignments after each module and a final certification exam.

What is Dialogflow CX?

lesson 01~15 min read

Dialogflow CX is Google Cloud's enterprise-grade conversational AI platform. It lets you build sophisticated chatbots and voice bots using a visual flow-based interface โ€” without writing extensive code. Think of it as the "Figma of chatbot building."

๐Ÿ’ก

CX vs ES โ€” Which one?

Dialogflow comes in two flavors: ES (Essentials) for simple linear bots, and CX (Customer Experience) for complex, multi-turn, stateful conversations. This course covers CX exclusively.

Why Dialogflow CX?

FeatureDialogflow ESDialogflow CX
ArchitectureIntent-based flatFlow + Page based (stateful)
Best forSimple FAQ botsComplex multi-turn agents
Visual builderBasicAdvanced flow canvas
State managementLimitedFull session state
Testing toolsBasic simulatorConversation replays, CI/CD
PricingPer requestPer session / per request

Real-World Use Cases

  • ๐Ÿฆ Banking โ€” account balance, fund transfers, loan applications
  • ๐Ÿ›’ E-commerce โ€” order tracking, returns, product Q&A
  • โœˆ๏ธ Travel โ€” flight booking, itinerary changes, check-in
  • ๐Ÿฅ Healthcare โ€” appointment scheduling, symptom triage
  • ๐Ÿ“ž Contact Centers โ€” IVR replacement, agent handoff

The Dialogflow CX Console

Everything in this course can be done in the visual console at dialogflow.cloud.google.com. Here's how to get started:

  1. Go to console.cloud.google.com and create a project
  2. Enable the Dialogflow API in APIs & Services
  3. Navigate to Dialogflow CX and create an Agent
  4. Choose a region (us-central1 recommended for beginners)
  5. Your agent is ready โ€” the visual canvas opens automatically
โœ…

Free Tier

Google Cloud offers a $300 free credit for new accounts. Dialogflow CX also has a free tier: 600 text sessions/month free. Perfect for learning!

Assignment 1: Setup Your Environment

โฑ 20 min
  1. Create a Google Cloud account (if you don't have one)
  2. Create a new GCP project named "dfcx-learning"
  3. Enable the Dialogflow CX API
  4. Create your first Agent named "MyFirstAgent" in us-central1
  5. Take a screenshot of the Dialogflow CX canvas with your agent open
Deliverable: Screenshot of your agent's flow canvas showing the Default Start Flow and Default Welcome Intent.

Core Concepts

lesson 02~20 min read

Before building anything, you need a mental model of Dialogflow CX's architecture. It's elegantly hierarchical โ€” everything nests inside everything else.

The Architecture Hierarchy

DIALOGFLOW CX HIERARCHY
๐Ÿค– AGENT
โ†“
๐Ÿ“Š FLOWS (1..N)
โ†“
๐Ÿ“„ PAGES (1..N)
โ†“
๐ŸŽฏ INTENTS
โ†“
โœ… FULFILLMENT

Core Components

๐Ÿค–
top level

Agent

The top-level container. One agent per use case (e.g., "Customer Support Bot"). Configured with a language and region.

๐Ÿ“Š
routing

Flows

Module-like containers grouping related conversations. E.g., "Account Flow", "Order Flow". Each agent has a Default Start Flow.

๐Ÿ“„
state

Pages

The current "state" of a conversation. The bot is always on exactly one page at a time. Pages contain entry fulfillments, routes, and forms.

๐ŸŽฏ
understanding

Intents

What the user wants. Defined by training phrases. E.g., "book a flight" intent matches "I want to fly to Paris" and similar utterances.

๐Ÿ“ฆ
extraction

Entities

Named pieces of data extracted from utterances. E.g., from "flight to Paris on Monday", extract city=Paris, date=Monday.

โšก
execution

Fulfillment

What happens when a route is taken โ€” send a message, call a webhook, set a parameter, or transition to another page/flow.

How a Conversation Works

User message
โ†’
NLU matches Intent
โ†’
Route fires
โ†’
Fulfillment runs
โ†’
New Page / Response

Sessions & State

Every conversation is a session. Each session maintains:

  • Current Page โ€” where the user is in the conversation
  • Session Parameters โ€” stored variables (e.g., $session.params.customer_name)
  • Flow history โ€” which flows have been visited
โš ๏ธ

Key Mental Model Shift

In Dialogflow CX, you think in states (pages), not just intents. The same intent can have different behaviors depending on which page the user is currently on. This is the #1 concept beginners miss.

๐Ÿง  Quick Check

1. In Dialogflow CX, what represents the "current state" of a conversation?

Flows & Pages

lesson 03~25 min read

Flows โ€” Modular Conversation Sections

A Flow is a reusable module for a topic area. Think of it like a function in programming. Large agents use multiple flows to stay organized.

Example Agent: "Telecom Support Bot"
โ”œโ”€โ”€ Default Start Flow       โ† entry point, routing
โ”œโ”€โ”€ Billing Flow             โ† all billing questions
โ”œโ”€โ”€ Technical Support Flow   โ† network/device issues
โ”œโ”€โ”€ Account Management Flow  โ† profile, password changes
โ””โ”€โ”€ Cancellation Flow        โ† retention & cancellationsstructure

Flow Entry Point

Every flow has a Start Page which is automatically entered when a flow is called. This is where you configure the flow's entry message and initial routing.

Pages โ€” Conversation States

Pages are where the magic happens. Every page can have:

  • Entry Fulfillment โ€” message spoken/shown when entering this page
  • Form (Parameters) โ€” information to collect from user
  • Transition Routes โ€” where to go next based on user input
  • Event Handlers โ€” what to do on no-match, no-input, etc.

A Real Example: Flight Booking

Pages in "Booking Flow":
  
  [Start] 
    Entry: "Welcome! Where would you like to fly?"
    โ†’ user provides origin/destination โ†’ [Collect Dates]

  [Collect Dates]
    Entry: "What are your travel dates?"
    Form: departure_date, return_date
    โ†’ form complete โ†’ [Select Seat]

  [Select Seat]  
    Entry: "Window or aisle seat?"
    โ†’ user answers โ†’ [Confirmation]

  [Confirmation]
    Entry: "Your booking is confirmed! โœˆ๏ธ"
    โ†’ ENDpage flow

Page Transitions

Pages transition via Routes. A route fires when:

  • A specific Intent is matched (e.g., user confirms booking)
  • A Condition is true (e.g., all form fields collected)
  • An Event occurs (e.g., no-match 3 times โ†’ escalate)
PAGE TRANSITION EXAMPLE
[Greeting Page]
โ†’ intent: confirm โ†’
[Collect Info Page]
โ†’ form complete โ†’
[Summary Page]

Default Start Flow

Every agent automatically has a Default Start Flow with a Default Welcome Intent. This fires when the user first opens the chat and typically sends a greeting message.

Try the Simulator

Flight Bot Simulator ยท Default Start Flow
๐Ÿ‘‹ Hello
โœˆ๏ธ Book a flight
โ“ Help
๐Ÿค–
Hi there! I'm your flight assistant. Try saying "Book a flight" or tap a chip above.

Assignment 2: Build Your First Flow

โฑ 30 min
  1. In your agent, create a new Flow called "Restaurant Booking Flow"
  2. Add these pages: Greeting โ†’ Collect Party Size โ†’ Collect Date โ†’ Confirmation
  3. Add Entry Fulfillment messages to each page (make them natural!)
  4. Connect the pages with simple routes (don't worry about intents yet)
  5. Test in the Dialogflow simulator by manually triggering transitions
Deliverable: Screenshot of your flow diagram in the Dialogflow CX canvas showing all 4 pages connected.

Intents & Entities

lesson 04~25 min read

Intents โ€” What the User Wants

An Intent represents the goal behind a user's message. You teach each intent with Training Phrases โ€” example sentences. Dialogflow's NLU model generalizes from these examples.

Creating a Good Intent

Intent Name: "book.flight"

Training Phrases:
  - "I want to book a flight"
  - "Can I reserve a seat?"
  - "Book me a ticket to New York"
  - "I need to fly to London next week"
  - "Schedule a flight for tomorrow"
  - "Reserve two seats on the 3pm flight"
  - "Looking for flights to Paris"
  - "How do I buy a plane ticket?"
  - "I'd like to travel to Tokyo"
  - "Help me book air travel"
  (add 10-20 varied phrases for best accuracy)intent config
โœ…

Training Phrase Best Practices

Add 10โ€“20 varied phrases. Include formal and informal language. Include phrases with and without entities. Avoid copying the same phrase slightly reworded โ€” variety is key.

Entities โ€” What to Extract

Entities extract structured data from free-form text. There are three types:

TypeDescriptionExample
SystemBuilt-in by Google@sys.date, @sys.number, @sys.city
CustomYou define values + synonyms@seat-type: window, aisle, middle
RegexPattern-based extraction@booking-id: BK[0-9]{6}

Custom Entity Example

Entity: @pizza-size
  Values:
    - small      (synonyms: tiny, personal)
    - medium     (synonyms: regular, standard)
    - large      (synonyms: big, family, jumbo)
    - extra-large (synonyms: XL, extra large, huge)

Usage in training phrase:
  "I want a [large](@pizza-size) pepperoni pizza"
  โ†’ extracts: pizza-size = "large"entity config

Annotating Training Phrases

When you type a training phrase in the console and highlight a word, Dialogflow lets you tag it with an entity. This creates a parameter automatically.

Training phrase: "Book a flight from Chicago to Miami on Friday"

Annotations:
  "Chicago"  โ†’ @sys.geo-city    โ†’ parameter: origin_city
  "Miami"    โ†’ @sys.geo-city    โ†’ parameter: destination_city  
  "Friday"   โ†’ @sys.date-period โ†’ parameter: travel_dateannotation

System Entities Cheat Sheet

EntityMatchesExample
@sys.numberNumbers"three", "3", "fifteen"
@sys.dateDates"tomorrow", "March 5th", "next Monday"
@sys.timeTimes"3pm", "noon", "at 15:00"
@sys.emailEmails"user@example.com"
@sys.phone-numberPhone numbers"+1 555-0100"
@sys.currency-nameCurrency"dollars", "USD", "euros"

๐Ÿง  Quiz: Intents & Entities

1. Which entity type should you use to extract a phone number from user input?

2. How many training phrases is recommended per intent for good NLU accuracy?

Assignment 3: Intents & Entities

โฑ 45 min
  1. Create intent "order.pizza" with 15 varied training phrases
  2. Create intent "cancel.order" with 10 training phrases
  3. Create custom entity @pizza-topping with 5 values, each with 2 synonyms
  4. Annotate 5 of your "order.pizza" training phrases with @pizza-topping and @sys.number
  5. Test in the simulator: type "I want 2 large margherita pizzas" and verify entity extraction
Deliverable: Screenshot of your annotated intent showing extracted entities highlighted in the training phrases.

Fulfillment & Webhooks

lesson 05~30 min read

What is Fulfillment?

Fulfillment is what happens when a route fires. It can be one or more of:

  • ๐Ÿ“ Static Response โ€” send a text/card/chip response
  • ๐Ÿ”„ Parameter Preset โ€” set a session parameter value
  • ๐ŸŒ Webhook Call โ€” call an external API
  • โ†ฉ๏ธ Transition โ€” move to another page/flow

Response Types

// TEXT RESPONSE
"Your order has been placed! ๐ŸŽ‰"

// RICH RESPONSE (chips)
Text: "How can I help you?"
Suggestion chips: ["Check order", "Cancel order", "Talk to agent"]

// CUSTOM PAYLOAD (for frontend)
{
  "richContent": [[{
    "type": "chips",
    "options": [
      {"text": "Order Pizza"},
      {"text": "Track Order"}
    ]
  }]]
}response types

Webhooks โ€” The Power Feature

Webhooks allow Dialogflow CX to call your backend service in real time. This enables dynamic responses, database lookups, and API integrations.

User input
โ†’
Intent matched
โ†’
Webhook called
โ†’
Your Server
โ†’
Dynamic Response

Webhook Request Format

// DIALOGFLOW SENDS THIS TO YOUR ENDPOINT:
POST https://your-server.com/webhook

{
  "detectIntentResponseId": "abc-123",
  "intentInfo": {
    "lastMatchedIntent": "projects/.../intents/order-pizza",
    "parameters": {
      "pizza-size": { "stringValue": "large" },
      "pizza-topping": { "stringValue": "pepperoni" }
    }
  },
  "sessionInfo": {
    "session": "projects/.../sessions/session-123",
    "parameters": {
      "customer_name": "Amir",
      "loyalty_points": 250
    }
  },
  "text": "I want a large pepperoni pizza"
}webhook request

Webhook Response Format

// YOUR SERVER RETURNS THIS:
{
  "fulfillment_response": {
    "messages": [{
      "text": {
        "text": ["Order confirmed! Your large pepperoni pizza will arrive in 30 mins."]
      }
    }]
  },
  "session_info": {
    "parameters": {
      "order_id": "ORD-98765",
      "estimated_time": "30 minutes"
    }
  }
}webhook response

Simple Python Webhook (Cloud Functions)

import functions_framework
import json

@functions_framework.http
def dialogflow_webhook(request):
    req = request.get_json()
    
    # Get parameters from session
    params = req.get('sessionInfo', {}).get('parameters', {})
    pizza_size = params.get('pizza-size', 'medium')
    topping = params.get('pizza-topping', 'cheese')
    
    # Business logic
    prices = {'small': 8, 'medium': 12, 'large': 16}
    price = prices.get(pizza_size, 12)
    order_id = "ORD-" + str(hash(pizza_size+topping))[-5:]
    
    return {
        "fulfillment_response": {
            "messages": [{
                "text": {
                    "text": [f"โœ… Order #{order_id}: {pizza_size} {topping} pizza - ${price}. Ready in 25 mins!"]
                }
            }]
        },
        "session_info": {
            "parameters": {
                "order_id": order_id,
                "order_price": price
            }
        }
    }python webhook
๐Ÿ’ก

Webhook Timeout

Dialogflow CX has a 5-second webhook timeout. Keep your webhook responses fast. Use async patterns for slow operations and return a "processing" message first if needed.

Assignment 4: Build a Webhook

โฑ 60 min
  1. Deploy the Python webhook above to Google Cloud Functions (or use webhook.site for testing)
  2. Register your webhook URL in Dialogflow CX: Agent Settings โ†’ Webhooks
  3. Add the webhook to your pizza order intent's fulfillment
  4. Test that ordering a pizza returns the dynamic order ID and price
  5. Extend the webhook to also handle "cancel.order" intent โ€” return "Order cancelled successfully."
Deliverable: Screenshot of the simulator showing a dynamic webhook response with an order ID.

State Handlers

lesson 06~20 min read

What are State Handlers?

State handlers are rules attached to a Page or Flow that determine what happens next. There are 4 types:

๐ŸŽฏ
intent-based

Intent Routes

Fires when a specific intent is matched. The most common handler โ€” "when user says X, do Y."

๐Ÿ”€
logic-based

Condition Routes

Fires when a parameter-based condition is true. E.g., $session.params.order_total > 50

๐Ÿ“‹
form-based

Form Completion

Fires when all required parameters in a form have been collected from the user.

โšก
system events

Event Handlers

Fires on system events: sys.no-match, sys.no-input, WELCOME, custom events.

Condition Route Examples

// Route fires if order total is over $50 (add free delivery)
Condition: $session.params.order_total > 50
Action: Set delivery_fee = 0, say "Free delivery on your order!"

// Route fires if user is a premium member
Condition: $session.params.membership_tier = "premium"
Action: Transition to PremiumServicesPage

// Route fires if all form parameters collected
Condition: $page.params.status = "FINAL"  
Action: Transition to ConfirmationPage

// Combining conditions
Condition: $session.params.age >= 18 AND $session.params.country = "US"
Action: Show age-restricted content pageconditions

Event Handlers โ€” Error Recovery

Event handlers are crucial for graceful failure handling:

Event: sys.no-match-1      โ†’ "Sorry, I didn't understand. Can you rephrase?"
Event: sys.no-match-2      โ†’ "I'm still having trouble. Here are some options..."
Event: sys.no-match-default โ†’ Transfer to live agent
Event: sys.no-input-1      โ†’ "Are you still there?"
Event: sys.no-input-default โ†’ "I'll end the session now. Goodbye!"event handlers
โœ…

Route Priority

When multiple routes could fire, Dialogflow CX evaluates them in order: Intent Routes first, then Condition Routes, then Event Handlers. Order your routes intentionally โ€” the first matching route wins.

Scope: Page vs. Flow Handlers

LevelScopeUse When
Page HandlerOnly fires on this specific pagePage-specific logic (e.g., "confirm order" only on order page)
Flow HandlerFires anywhere within this flowGlobal escapes (e.g., "cancel" intent reachable from any page)
Start Page HandlerFires before any page in the flowEntry-level routing, authentication checks

๐Ÿง  Quiz: State Handlers

You want the user to be able to say "cancel" from ANY page in your "Order Flow". Where should you add the cancel intent route?

Parameters & Forms

lesson 07~20 min read

Session Parameters

Parameters are variables stored in the session. They persist across the entire conversation and can be read/written anywhere.

// REFERENCE SYNTAX
$session.params.customer_name    // from session
$intent.params.pizza_size        // from current intent
$page.params.status              // form status
$flow.params.flow_variable       // from current flow

// IN RESPONSE TEXT (interpolation)
"Hello $session.params.customer_name! Your order is confirmed."
โ†’ renders as: "Hello Amir! Your order is confirmed."parameter syntax

Forms โ€” Collecting Multiple Parameters

A Form is a set of parameters a page needs to collect before proceeding. Dialogflow CX automatically prompts the user for any missing parameters.

Page: "Collect Flight Details"
Form Parameters:
  - origin_city     (required) โ†’ @sys.geo-city
    Prompt: "Where are you flying from?"
    
  - destination_city (required) โ†’ @sys.geo-city
    Prompt: "And where are you flying to?"
    
  - travel_date     (required) โ†’ @sys.date
    Prompt: "What's your travel date?"
    
  - num_passengers  (optional) โ†’ @sys.number
    Prompt: "How many passengers?"

// When ALL required params are filled:
$page.params.status = "FINAL"
โ†’ Condition route fires โ†’ transition to next pageform config

Form Reprompt โ€” Handling Invalid Input

Parameter: travel_date
  Initial prompt: "What date would you like to travel?"
  
  Reprompt event handlers:
    sys.no-match-1: "I didn't catch that. Please say a date like 'March 15' or 'next Friday'."
    sys.no-match-2: "Let me try again โ€” what date works for you? Example: 'April 1st'"
    sys.no-match-default: "I'm having trouble with the date. Let me connect you with an agent."reprompt

Parameter Presets

You can set parameters programmatically in fulfillment without collecting from user:

// In a route's fulfillment โ†’ Parameter Presets:
loyalty_tier = "gold"
session_start_time = "2024-01-15T10:30:00"
agent_name = "Max"

// Conditional preset based on other params:
discount_pct = IF($session.params.loyalty_tier == "gold", 15, 0)parameter presets
๐Ÿ’ก

Inaccessible Parameters

$intent.params only contains parameters from the current intent match. Once you transition to a new page or the intent changes, always copy important values to $session.params so they persist.

Assignment 5: Build a Multi-Step Form

โฑ 45 min
  1. Create a page called "Collect Reservation Info"
  2. Add a form with 4 parameters: customer_name, party_size, date, time
  3. Write custom prompts for each parameter (natural language)
  4. Add reprompt handlers for each parameter (at least 2 reprompts)
  5. On form completion, transition to a Confirmation page that says: "Thanks [name]! Table for [size] on [date] at [time] โ€” confirmed!"
Deliverable: Video or screenshot sequence showing the bot collecting all 4 form parameters in a test conversation.

Route Groups & Versions

lesson 08~15 min read

Route Groups โ€” Reusable Logic

Route Groups let you define a set of routes once and reuse them across multiple pages. Perfect for global commands like "help", "cancel", "repeat", or "talk to agent".

Route Group: "Global Commands"
  Routes:
    - Intent: talk.to.agent    โ†’ Transition to [Live Agent Page]
    - Intent: repeat.last      โ†’ Fulfillment: repeat last response
    - Intent: main.menu        โ†’ Transition to [Main Menu Page]
    - Intent: goodbye          โ†’ Fulfillment: "Goodbye!" โ†’ END

// Apply to multiple pages in one click
// Instead of adding these routes to every page manuallyroute group

Environments & Versions

Versions let you snapshot your agent at a point in time. Environments let you run different versions simultaneously.

ConceptDescriptionUse Case
DraftWorking version (always editable)Development
VersionNamed snapshot (immutable)"v1.2.0-stable"
EnvironmentNamed deployment targetDevelopment, Staging, Production
Typical workflow:
  1. Edit in Draft
  2. Create Version: "v2.3.0" with description
  3. Deploy to Staging environment โ†’ test
  4. Deploy to Production environment โ†’ go live
  5. If issues โ†’ rollback to previous version in secondsdeployment workflow

CI/CD Integration

# Deploy version via gcloud CLI
gcloud dialogflow cx versions create \
  --agent=AGENT_ID \
  --flow=START_FLOW_ID \
  --display-name="v2.3.0" \
  --description="Added pizza customization flow"

# Deploy to environment  
gcloud dialogflow cx environments deploy \
  --environment=ENVIRONMENT_ID \
  --flow-version=FLOW_VERSION_IDgcloud cli

Project: Build a Pizza Ordering Bot ๐Ÿ•

project 01~90 min build

Let's build a complete pizza ordering bot from scratch, applying everything we've learned.

Architecture Overview

PIZZA BOT ARCHITECTURE
========================
Agent: "PizzaBot"
โ”‚
โ”œโ”€โ”€ Default Start Flow
โ”‚   โ””โ”€โ”€ Start Page
โ”‚       โ”œโ”€โ”€ WELCOME โ†’ Greeting Page
โ”‚       โ””โ”€โ”€ Intent: start.ordering โ†’ Order Flow
โ”‚
โ””โ”€โ”€ Order Flow
    โ”œโ”€โ”€ Start Page (entry)
    โ”œโ”€โ”€ Choose Pizza Page     (form: size, crust, toppings)
    โ”œโ”€โ”€ Customize Page        (extras, sauce)
    โ”œโ”€โ”€ Confirm Order Page    (show summary, confirm/edit)
    โ”œโ”€โ”€ Payment Page          (collect payment method)
    โ””โ”€โ”€ Order Confirmed Page  (webhook: submit order)

Route Groups:
    - Global: cancel, help, restartarchitecture

Step 1: Create the Entities

@pizza-size:    small, medium, large, xl
@pizza-crust:   thin, thick, stuffed, gluten-free
@pizza-topping: pepperoni, mushroom, onion, pepper, 
                olive, bacon, chicken, extra-cheese
@payment-type:  card, cash, apple-pay, google-payentities

Step 2: Create the Intents

order.pizza         โ€” "I want to order a pizza", "Let's get a pizza"
confirm.order       โ€” "Yes", "Confirm", "That's right", "Place the order"
edit.order          โ€” "Change my order", "Actually...", "Wait, I want..."
cancel.order        โ€” "Cancel", "Never mind", "Stop"
ask.for.help        โ€” "Help", "What can you do?", "Options"
provide.pizza.size  โ€” "Large please", "Make it medium"
provide.toppings    โ€” "Add pepperoni and mushrooms"intents

Step 3: Build the "Choose Pizza" Page

Page: "Choose Pizza"
Entry Fulfillment: "Great! Let's build your perfect pizza. ๐Ÿ•"

Form Parameters:
  pizza_size   โ†’ @pizza-size
    Prompt: "What size? Small ($8), Medium ($12), Large ($16), or XL ($20)?"
    
  pizza_crust  โ†’ @pizza-crust  
    Prompt: "What crust? Thin, thick, stuffed, or gluten-free?"
    
  pizza_toppings โ†’ @pizza-topping (list)
    Prompt: "Choose your toppings: pepperoni, mushroom, onion, pepper, olive, bacon, chicken, or extra cheese?"

Condition Route (form complete):
  $page.params.status = "FINAL" โ†’ Transition to [Confirm Order Page]page config

Step 4: Confirmation Page

Page: "Confirm Order"
Entry Fulfillment:
  "Here's your order summary:
   ๐Ÿ• $session.params.pizza_size $session.params.pizza_crust pizza
   Toppings: $session.params.pizza_toppings
   Total: $session.params.calculated_price
   
   Ready to place your order?"
   
   Chips: ["โœ… Yes, place order", "โœ๏ธ Edit order", "โŒ Cancel"]

Routes:
  Intent: confirm.order โ†’ Webhook (submit) โ†’ [Order Confirmed Page]
  Intent: edit.order    โ†’ Transition to [Choose Pizza Page]
  Intent: cancel.order  โ†’ Fulfillment: "Order cancelled." โ†’ ENDconfirmation page

Live Demo

๐Ÿ• PizzaBot Live Demo
๐Ÿ• Order Pizza
Small
Large
โœ… Confirm
โŒ Cancel
๐Ÿ•
Welcome to PizzaBot! ๐Ÿ• Ready to order? Tap "Order Pizza" to start!

Assignment 6: Complete Pizza Bot

โฑ 90 min
  1. Build the complete agent architecture described above in Dialogflow CX
  2. Implement all 4 entities and 7 intents with proper training phrases
  3. Build all 6 pages with proper forms, routes, and entry fulfillments
  4. Add a webhook that calculates the price dynamically based on size
  5. Add a "Global Commands" Route Group with cancel, help, and restart
  6. Add no-match handlers on every page that re-prompts helpfully
Deliverable: A full conversation test showing: greeting โ†’ size โ†’ crust โ†’ toppings โ†’ confirmation โ†’ order placed, with dynamic order ID from webhook.

Project: Banking Support Bot ๐Ÿฆ

project 02~120 min build

A more complex agent with authentication, multiple flows, and conditional routing โ€” a production-like scenario.

Architecture

BANKING BOT ARCHITECTURE
=========================
Agent: "BankBot"
โ”‚
โ”œโ”€โ”€ Default Start Flow
โ”‚   โ”œโ”€โ”€ Authenticate User Page  โ† verify account number
โ”‚   โ””โ”€โ”€ Main Menu Page          โ† routing hub
โ”‚
โ”œโ”€โ”€ Account Flow
โ”‚   โ”œโ”€โ”€ Check Balance Page      โ† webhook: get balance
โ”‚   โ”œโ”€โ”€ Recent Transactions Page โ† webhook: get transactions
โ”‚   โ””โ”€โ”€ Account Details Page
โ”‚
โ”œโ”€โ”€ Transfer Flow
โ”‚   โ”œโ”€โ”€ Enter Amount Page       โ† form: amount, account
โ”‚   โ”œโ”€โ”€ Confirm Transfer Page
โ”‚   โ””โ”€โ”€ Transfer Complete Page  โ† webhook: execute transfer
โ”‚
โ”œโ”€โ”€ Support Flow
โ”‚   โ”œโ”€โ”€ Report Card Lost Page
โ”‚   โ”œโ”€โ”€ Dispute Transaction Page
โ”‚   โ””โ”€โ”€ Live Agent Transfer Page
โ”‚
โ””โ”€โ”€ Global Route Group
    โ””โ”€โ”€ "main menu", "help", "logout"architecture

Authentication Pattern

Page: "Authenticate User"
Entry: "Welcome to SecureBank. Please enter your account number."

Form:
  account_number โ†’ @sys.number (6 digits)

On form complete โ†’ Webhook: verify_account
  IF webhook returns verified=true:
    Set session.params.authenticated = true
    Set session.params.customer_name = [from webhook]
    Transition to [Main Menu]
  IF webhook returns verified=false:
    Increment session.params.auth_attempts
    IF auth_attempts >= 3 โ†’ Transition to [Locked Account Page]
    ELSE โ†’ Reprompt: "Account not found. Please try again."auth page

Conditional Routing Based on Authentication

// On Start Page โ€” check auth before anything
Route 1 (highest priority):
  Condition: $session.params.authenticated != true
  Action: Transition to [Authenticate User Page]

Route 2:  
  Intent: check.balance
  Condition: $session.params.authenticated = true
  Action: Transition to Account Flow โ†’ Check Balance Page

// This pattern prevents unauthenticated access to any sensitive pageauth guard

Transfer Flow โ€” Advanced Form

Page: "Enter Transfer Details"
Form:
  transfer_amount   โ†’ @sys.number
    Prompt: "How much would you like to transfer?"
    Validation webhook: check sufficient funds
    
  recipient_account โ†’ @sys.number
    Prompt: "Enter the recipient's account number."
    
  transfer_note     โ†’ @sys.any (optional)
    Prompt: "Any note for this transfer? (optional, say 'skip' to continue)"

On form complete:
  Condition: $session.params.transfer_amount > $session.params.account_balance
  โ†’ Fulfillment: "Insufficient funds. Your balance is $X."
  โ†’ Transition back to [Enter Transfer Details]
  
  Condition: $session.params.transfer_amount <= $session.params.account_balance
  โ†’ Transition to [Confirm Transfer Page]transfer form

Assignment 7: Banking Bot

โฑ 120 min
  1. Build the complete banking bot architecture (all 4 flows)
  2. Implement the authentication pattern with account number verification
  3. Build the transfer flow with balance validation
  4. Add a mock webhook that simulates account balance lookup (hardcode a few accounts)
  5. Add the "report card lost" page that collects: reason, last known location, new card needed (y/n)
  6. Add a "Talk to Agent" option accessible from anywhere that summarizes the conversation and passes to a live agent
Deliverable: Full walkthrough showing: authenticate โ†’ check balance โ†’ initiate transfer โ†’ confirm โ†’ complete. Plus one failed auth attempt recovery.

Testing & Debugging

lesson 11~20 min read

The Test Console

Dialogflow CX has a built-in test simulator accessible from the right panel. It shows:

  • Current page and flow
  • Matched intent and confidence score
  • Extracted parameters and their values
  • Which route was triggered
  • Webhook request/response details

Conversation Replay

A powerful CX feature โ€” record test conversations and replay them to detect regressions after changes.

// Test conversation format (YAML)
test_cases:
  - display_name: "Complete Pizza Order"
    conversation_turns:
      - user_input: "I want to order a pizza"
        virtual_agent_output:
          triggered_intent: "order.pizza"
          current_page: "Choose Pizza"
          
      - user_input: "Large pepperoni"
        virtual_agent_output:
          current_page: "Choose Pizza"
          session_parameters:
            pizza_size: "large"
            pizza_toppings: ["pepperoni"]test case yaml

Common Issues & Fixes

IssueSymptomFix
Wrong intent matchedBot goes to wrong pageAdd more varied training phrases; check for overlapping intents
Entity not extractedParameter is nullAnnotate more training phrases; check entity type is correct
Form never completesBot keeps asking same questionCheck parameter entity type matches user input format
Webhook timeoutError response after 5sOptimize backend; add async pattern with quick ack
Routes not firingNo transition happensCheck route order; verify condition syntax; check intent is active on this page

Validation Tool

// Run validation before deploying:
gcloud dialogflow cx agents validate --agent=AGENT_ID

// Returns warnings like:
// WARNING: Intent 'order.pizza' has only 3 training phrases (minimum: 10)
// WARNING: Page 'Confirm Order' has no no-match handler
// ERROR: Webhook 'process-order' URL returns 404validation

Final Exam ๐ŸŽ“

certification20 questions ยท pass = 70%

Complete the following exam to earn your Dialogflow CX completion certificate. You need 14/20 correct (70%) to pass.

๐Ÿ“ Final Exam โ€” Dialogflow CX

1. What is the hierarchy order in Dialogflow CX from top to bottom?

2. What does $page.params.status = "FINAL" indicate?

3. Which system entity extracts "next Monday" from user input?

4. What is the webhook timeout limit in Dialogflow CX?

5. To make a "help" intent available from ANY page in a flow, you should add it to:

6. Which parameter reference retrieves a value set in the current session?

7. What fires when a user doesn't respond to a bot prompt (voice channel)?

8. Dialogflow CX differs from Dialogflow ES primarily because CX uses:

9. What is the correct webhook response field to update session parameters?

10. How many training phrases are recommended for good intent accuracy?